In this article, we will explore the operating principles and key components of a computer.
Turing Machine
A general computation model that can theoretically solve any computational problem. It provides fundamental theories and concepts in modern computer science. Thus, the Turing Machine is an essential concept in fields like algorithm theory, computational theory, programming languages, compiler theory, and computer architecture.
Key Components
- Tape: An infinitely long two-directional tape where symbols 0 or 1 can be recorded.
- Head: Reads and writes on the tape and can identify the symbol at its current position.
- States and Rules: Represents the machine's current internal state and operations. In the diagram above, A, B, C, and H are states. Each state defines what symbol to write, in which direction to move the head, and which state to transition to next.
- Example: If the current state is A and the symbol read from the tape is 0, write P(1) on the current symbol, change the next state to B, and move the tape to the right (R).
The Turing machine continuously reads, writes, and moves the tape following these rules. Through iterative state changes and head movements, any computational problem can be addressed.
A contemporary device with a similar structure is the hard disk drive (which will be introduced as a storage device in the following content).
All data stored in a computer is represented by the digital signals 0 and 1. For hard disks, these digital signals are recorded on disk-shaped platters. These signals are stored using variations in magnetic field densities. A needle (head) recognizes a change in the magnetic field's polarity as 1, and its absence as 0.
Von Neumann Architecture
One of the foundational concepts that influenced the majority of modern computer systems and architectures.
Key Features
- Single Central Processing Unit: Von Neumann architecture employs one central processing unit (CPU). The CPU is responsible for computation and control, executing program instructions sequentially.
- Memory: In the Von Neumann architecture, data and program instructions are stored in memory. This memory serves as a device to read from and write to.
- Storage Device: Before being read and executed from memory, data and programs are copied from storage devices to memory. Storage devices can be in the form of hard disks, SSDs, etc.
- Program Counter: The CPU has a program counter that points to the location of the currently executing instruction. This counter indicates the address of the next instruction to be executed.
- Instruction Set: In the Von Neumann architecture, instructions are represented in binary code, and the CPU interprets and executes them. These instructions can perform various tasks such as data processing, calculations, branching, memory access, etc.
- Separation of Program and Data: In the Von Neumann architecture, both the program and the data are stored in memory. The CPU differentiates and processes them. This allows a program to modify itself or load a new program during execution.